package org.bees.cms.common;

import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;

public class Generic<Parameter> {
	protected Class<Parameter> parameter;

	@SuppressWarnings("unchecked")
	protected Generic() {
		Class<?> clazz = getClass();
		Type superclass = clazz.getGenericSuperclass();
		if (superclass instanceof ParameterizedType) {
			Type[] types = ((ParameterizedType) superclass).getActualTypeArguments();
			parameter = (Class<Parameter>) types[0];
		}
	}

}
